using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerWallJumpState : PlayerState
{
    public PlayerWallJumpState(Player player, PlayerStateMachine playerStateMachine, string animBoolName) : base(player, playerStateMachine, animBoolName)
    {
    }

    public override void Enter()
    {
        base.Enter();
        stateTime = .4f;
        player.SetVelocity(5 * -player.faceDir, player.jumpForce);
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void Update()
    {
        base.Update();
        if (stateTime < 0)
            playerStateMachine.ChangeState(player.playerAirState);
        if (player.isGround())
            playerStateMachine.ChangeState(player.playerIdleState);
    }
}
